package lumis.doui.source.field.type;

import lumis.doui.datatype.IDouiDataType;
import lumis.doui.source.ISourceContext;
import lumis.portal.PortalException;
import lumis.portal.stability.StableMinor;
import lumis.util.query.QueryFieldTypes;

/**
 * A data type of a {@link lumis.doui.source.field.ISourceField}
 * 
 * @since 4.0.4
 * @version $Revision: 13082 $ $Date: 2011-05-27 16:03:12 -0300 (Fri, 27 May 2011) $
 */
@StableMinor(version = "6.0", sinceVersion = "4.0")
public interface ISourceFieldDataType extends IDouiDataType
{
	/**
	 * Initializes this data type to be used in the given source context.
	 * @param sourceContext the source context where this data type will be used in.
	 * @since 4.0.4
	 */
	public void init(ISourceContext sourceContext) throws PortalException;
	
	/**
	 * Returns a {@link QueryFieldTypes} constant for a query data type the
	 * value of this source field data type is best suited to be kept in.
	 * @return a {@link QueryFieldTypes} constant.
	 * @since 4.0.4
	 */
	public String getQueryDataType();
}
